package com.example.leetcode.graph;

import com.example.leetcode.graph.common.GraphUtils;

class Solution1514 {
    public double maxProbability(int n, int[][] edges, double[] succProb, int start, int end) {
        return GraphUtils.maxProbability(n, edges, succProb, start, end);
    }
}

public class leetcode1514 {
    public static void main(String[] args) {
        Solution1514 solution1514 = new Solution1514();

        int[][] edges = {{0, 1}, {1, 2}, {0, 2}};
        double[] succProb = {0.5, 0.5, 0.2};
        System.out.println(solution1514.maxProbability(3, edges, succProb, 0, 2));

        int[][] edges1 = {{0, 1}, {1, 2}, {0, 2}};
        double[] succProb1 = {0.5, 0.5, 0.3};
        System.out.println(solution1514.maxProbability(3, edges1, succProb1, 0, 2));

        int[][] edges2 = {{1, 4}, {2, 4}, {0, 4}, {0, 3}, {0, 2}, {2, 3}};
        double[] succProb2 = {0.37, 0.17, 0.93, 0.23, 0.39, 0.04};
        System.out.println(solution1514.maxProbability(5, edges2, succProb2, 3, 4));
    }
}
